package org.tigris.mappedlexer.validator.implementation;

/**
 * Valdiate the input if is a alpha character.
 * 
 * @author zhisen.huang
 *
 */
public class AlphaValidator extends CompositeValidator {

	/**
	 * Get the next token with the constraints.
	 * 
	 * @param validators the constraints
	 */
	@Override
	public boolean validate(char chr) throws UnsupportedOperationException {
		/*
		 * added '_' because an name can be started with '_' Sep 14, 2006 Sam
		 * Huang
		 */

		return (chr >= 'a' && chr <= 'z') || (chr >= 'A' && chr <= 'Z')
				|| chr == '_';
		// return Character.isLetter(chr) || chr == '_';
	}

}
